Skip to content

OLS-2926 - Adding artifact exporting#1934

Open
JoaoFula wants to merge 1 commit into
openshift:mainfrom
JoaoFula:adding-artifact-exporting
Open

OLS-2926 - Adding artifact exporting#1934
JoaoFula wants to merge 1 commit into
openshift:mainfrom
JoaoFula:adding-artifact-exporting

Conversation

@JoaoFula
Copy link
Copy Markdown
Contributor

@JoaoFula JoaoFula commented May 13, 2026

Summary by CodeRabbit

  • Tests
    • Automated collection of OpenShift cluster artifacts and pod/container logs is now performed after each test run for improved diagnostics.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Warning

Rate limit exceeded

@JoaoFula has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 43 minutes and 13 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: df49c03e-372c-4194-8347-70978ed90f75

📥 Commits

Reviewing files that changed from the base of the PR and between 5598a5e and 32b6de9.

📒 Files selected for processing (1)
  • cypress.config.ts
📝 Walkthrough

Walkthrough

The PR adds artifact collection to Cypress configuration. After each spec run, helper functions execute oc commands to dump OpenShift cluster resources and container logs into a local artifacts directory, with support for custom KUBECONFIG paths.

Changes

Cluster Artifact Collection

Layer / File(s) Summary
Artifact collection helpers
cypress.config.ts (lines 3–76)
New imports for execSync, path, and helpers runOC() and gatherClusterArtifacts() that execute oc commands to export cluster resource YAML and pod/container logs to ./gui_test_screenshots/artifacts/cluster/. Constants define target resource kinds and log paths.
After-spec hook integration
cypress.config.ts (lines 159–160)
The existing after:spec hook now logs and invokes gatherClusterArtifacts() after video-deletion logic to collect artifacts on every spec completion.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 In clusters where Openshift services align,
A rabbit gathers logs and resources divine,
Each spec that runs leaves traces behind,
oc commands fetch the wisdom we find.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title 'OLS-2926 - Adding artifact exporting' directly aligns with the main objective of this changeset, which adds artifact-gathering functionality to the Cypress configuration.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from joshuawilson and xrajesh May 13, 2026 13:20
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 13, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kyoto for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cypress.config.ts`:
- Around line 39-42: gatherClusterArtifacts currently writes all artifacts into
a single clusterDir under ARTIFACTS_DIR which causes later specs to overwrite
earlier data; update gatherClusterArtifacts to accept the current spec
identifier (e.g., specName or specPath) and create a per-spec subdirectory
(e.g., path.join(ARTIFACTS_DIR, 'cluster', sanitize(specName))) before creating
podLogsDir so pods.yaml/services.yaml and logs are written per-spec, and update
all callers of gatherClusterArtifacts (the after-each hook) to pass the spec
name/path; ensure the spec string is sanitized to form a safe filesystem name.
- Line 3: Replace the shell-based execSync usage with execFileSync to avoid
shell interpolation: import execFileSync from 'child_process' (replace
execSync), change the runOC helper to accept an argv array (e.g. args: string[])
instead of a single interpolated string, and call execFileSync('oc', argsArray,
{ env: {..., KUBECONFIG: kubeconfigPath}, encoding: 'utf-8' }) so
KUBECONFIG_PATH and values like OLS_NAMESPACE are passed as discrete argv
entries rather than concatenated into a shell command; update all call sites
(lines ~26-35) to use array-based arguments like ['get','<resource>','-n',
OLS_NAMESPACE, '-o','yaml'].
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f18880ee-8a32-42c3-a9f1-3f4fe33c046d

📥 Commits

Reviewing files that changed from the base of the PR and between aa5087d and 5598a5e.

📒 Files selected for processing (1)
  • cypress.config.ts

Comment thread cypress.config.ts Outdated
Comment thread cypress.config.ts
@JoaoFula JoaoFula changed the title OLS-2926 - Adding first attempt at artifact exporting OLS-2926 - Adding artifact exporting May 13, 2026
@JoaoFula JoaoFula force-pushed the adding-artifact-exporting branch from 5598a5e to 32b6de9 Compare May 13, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant